//
// Created by 86138 on 2025/6/22.
//

#ifndef QINGDAO_UNIVERSITY_INSERTSORT_H
#define QINGDAO_UNIVERSITY_INSERTSORT_H
#include "../01-intro/c1-1.h"

namespace sweetcookie10_1 {

    typedef int KeyType;
    typedef int InfoType;

    struct RedType { // Record Type
        KeyType key;
        InfoType otherinfo;
    };

    #define MAXSIZE 20
    struct SqList {
        RedType base[MAXSIZE + 1];
        int length;
    };

    void InputFromFile(FILE* f, RedType &c);

    void Print(SqList L);

    void Print1(SqList L);

    void InsertSort(SqList &L); // 直接插入排序

    void BInsertSort(SqList &L); // 折半插入排序

    void ShellSort(SqList &L, int delta[], int t); // 按增量序列delta[0, t-1]对顺序表L做希尔排序
}
#endif //QINGDAO_UNIVERSITY_INSERTSORT_H
